#ifndef LISTITEM_H
#define LISTITEM_H

#include <QFrame>
#include <QLabel>
#include <QTextBrowser>
#include <QDateTime>
#include <QPushButton>
#include <QMovie>

#define DEFAULT_LISTITEM_HEIGHT   80
#define DEFAULT_STATUS_HEIGHT   40
#define DEFAULT_PROFILE_IMAGE_SIZE   48
#define DEFAULT_LABEL_BTN_SIZE  16
#define DEFAULT_PROFILE_IMAGE    ":/images/defaultIcon.png"
#define DEFAULT_FAVORIT_FULL_ICON  ":/images/icon_star_full.png"
#define DEFAULT_FAVORIT_EMPTY_ICON ":/images/icon_star_empty.png"
#define DEFAULT_REPLY_ICON  ":/images/icon_reply.png"
#define DEFAULT_TRASH_ICON  ":/images/icon_trash.png"
#define DEFAULT_THROBBER_ICON    ":images/icon_throbber.gif"

class TwitListItem : public QFrame
{
    Q_OBJECT
public:
    TwitListItem(QWidget *parent = 0);
    ~TwitListItem();
    void changeProfileImage(const QString filename = DEFAULT_PROFILE_IMAGE);
    void changeProfileImage(const QPixmap image);
    void changeStatus(const QString text);
    void changeCreatedAt(const QString date);
    void changeSource(const QString client);
    void enableFavorit(const bool favorited = false);
    void enableReply();
    void enableTrash();

    void SetIndPosition(int index);
    int GetIndPosition();

private:
    QLabel  *profileImage;
    QTextBrowser *status;
    QPushButton *favoritBtn;
        QLabel *favoritIcon;
    QPushButton *replyBtn;
    QPushButton *trashBtn;
        QLabel *trashIcon;
    QLabel *createdAt;
    QLabel *fromL;
    QLabel *source;
    QMovie *animIcon;
    int indexPosition;
    void updateStatusSize();

private slots:
    void favoritClick();
    void replyClick();
    void trashClick();

signals:
    void favoritClicked(int pos, bool favorited);
    void replyClicked(int pos);
    void trashClicked(int pos);

protected:
    void resizeEvent(QResizeEvent *event);
};

#endif // LISTITEM_H
